jz();




function jz(){
    layui.use(['form','jquery','layer'],function (){
        var form = layui.form;
        var layer = layui.layer;
        var $ = layui.$;

        //点击提交修改信息
        form.on('submit(*)',function (d){
            console.log(d.field);
            var data = d.field;
            //发送ajax 修改审核状态
            $.ajax({
                url:'/YltUser/AuditManage/addAuditTurn',
                type:'post',
                data:data,
                dataType:'json',
                success:function (res){
                    if (res.state == '200'){
                        layer.msg('审核驳回成功',{time:1000,icon:6},function (){
                            let index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                            parent.sxTable();
                        })
                    }else {
                        layer.msg("审核驳回失败",{time: 1000,icon:5},function (){
                            let index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        });
                    }
                },
                errors:function (e){
                    console.log(e);
                    console.log("请求失败")
                }
            })
            return false;
        })
        //点击取消关闭
        form.on('submit(qx)',function (d){
            //获取父级弹窗
            let index = parent.layer.getFrameIndex(window.name);
            //再执行关闭
            parent.layer.close(index);
        })
    })
}
